package com.yuexun.beilunpatient.ui.question.ui;

import android.os.Bundle;
import android.widget.TextView;

import com.yuexun.beilunpatient.R;
import com.yuexun.beilunpatient.base.BaseKJActivity;
import com.yuexun.beilunpatient.ui.question.adapter.QuestionReplyListAdapter;
import com.yuexun.beilunpatient.ui.question.bean.PatientQuestionBean;
import com.yuexun.beilunpatient.widget.FixedSwipeListView;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by chenss on 2018/3/22 0022.
 */

public class Act_Question_Detail extends BaseKJActivity {


    @Bind(R.id.ask_time)
    TextView askTime;
    @Bind(R.id.type)
    TextView typeT;
    @Bind(R.id.organization)
    TextView organization;
    @Bind(R.id.question_content)
    TextView questionContent;
    @Bind(R.id.content_list)
    FixedSwipeListView contentList;

    PatientQuestionBean questionBean;
    QuestionReplyListAdapter adapter;

    @Override
    public void setRootView() {
        setContentView(R.layout.act_question_detail);
        ButterKnife.bind(this);
    }

    @Override
    public void initData() {
        questionBean = (PatientQuestionBean) getIntent().getExtras().getSerializable("questionDtl");
        askTime.setText("时间：" + questionBean.getCreateTime());
        typeT.setText(questionBean.getType());
        organization.setText(questionBean.getHospName());
        questionContent.setText(questionBean.getContent());

        adapter = new QuestionReplyListAdapter(contentList, questionBean.getReply(), R.layout.item_question_reply);
        contentList.setAdapter(adapter);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    @OnClick(R.id.title_back)
    public void onViewClicked() {
        finish();
    }
}
